home *** CD-ROM | disk | FTP | other *** search
- /* Name: Scroll Screen
- ** Author: Paul Manias
- ** Copyright: DreamWorld Productions (c) 1996-1997. Freely distributable.
- **
- ** This demo allows you to legally scroll up to 50 screens in either
- ** direction by setting the HBUFFER flag. Normally we would blit blocks down
- ** the left and right hand side to give an impression of heaps of screens -
- ** see the MapEditor for this.
- **
- */
-
- MODULE 'dpkernel','dpkernel/dpkernel','graphics/pictures','files/files'
- MODULE 'screens','system/register','system/modules','input/joydata'
- MODULE 'graphics/screens','graphics/blitter'
-
- PROC main()
- DEF screen = NIL:PTR TO screen,
- joy = NIL:PTR TO joydata,
- pic = NIL:PTR TO picture,
- scrmodule = NIL:PTR TO module,
- picfile:filename
-
- picfile := [ ID_FILENAME, 'GMS:demos/data/PIC.Green']:filename
-
- IF dpkbase := OpenLibrary('GMS:libs/dpkernel.library',0)
- IF (scrmodule := Init([TAGS_MODULE,NIL,
- MODA_NUMBER, MOD_SCREENS,
- MODA_TABLETYPE, JMP_AMIGAE,
- TAGEND], NIL))
-
- scrbase := scrmodule.modbase
-
- IF (pic := Load(picfile, ID_PICTURE))
- screen := Get(ID_SCREEN)
- CopyStructure(pic,screen)
- screen.memptr1 := pic.bitmap.data
- screen.attrib := HSCROLL OR SBUFFER
- screen.bitmap.width := screen.width+16
-
- IF (screen := Init(screen,NIL))
- IF (joy := Init(Get(ID_JOYDATA),NIL))
- Display(screen)
- REPEAT
- Query(joy)
- screen.bmpxoffset := screen.bmpxoffset + joy.xchange
- MoveBitmap(screen)
- WaitVBL()
- UNTIL !(joy.buttons AND JD_LMB)
- Free(joy)
- ENDIF
- ENDIF
- Free(screen)
- Free(pic)
- ENDIF
- Free(scrmodule)
- ENDIF
- CloseDPK()
- ENDIF
- ENDPROC
-
-